using Godot;
using System;

public partial class 属性点滑块 : HSlider
{
    public override void _GuiInput(InputEvent @event)
    {
        if (@event is InputEventMouseButton mouseEvent && mouseEvent.Pressed)
        {
            float GrabberPos = (float)((Value - MinValue) / (MaxValue - MinValue)) * (Size.X - (float)Get("grabber_size"));
            var GrabberRect = new Rect2(GrabberPos, 0, (float)Get("grabber_size"), Size.Y);
            if (!GrabberRect.HasPoint(GetLocalMousePosition()))
            {
                GetViewport().SetInputAsHandled();
            }
        }
    }
}
